BasePanel:SubClass('MainPanel')
MainPanel.name="MainPanel"

function MainPanel:Init()
    if IsNull(self.panelObj) then
        self.base.Init(self)
        self:GetControl('btnRole','Button').onClick:AddListener(function ()
            self:BtnRoleClick()
        end)
        self:GetControl('btnEmail','Button').onClick:AddListener(function ()
            self:BtnEmailClick()
        end)
    end
end

function MainPanel:BtnRoleClick()
    BagPanel:Show()
end

function MainPanel:BtnEmailClick()
    local panelObj=ABMgr:LoadRes("ui",'EmailPanel',typeof(GameObject))
    panelObj.transform:SetParent(Canvas,false)
    panelObj.transform:SetAsLastSibling()
end